package ${package}.${rootArtifactId}.common.exception;

/**
 * @author weidong.lin
 * @date 2021/7/8 11:06
 */
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 7320592857614194731L;

    /**
     * 应用异常码
     */
    private String code;

    public BusinessException() {
        super();
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(String code, String message) {
        super(code + ": " + message);
        this.code = code;
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public BusinessException(String code, String message, Throwable cause) {
        super(code + ": " + message, cause);
        this.code = code;
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
